package org.apache.catalina.core;

import org.apache.catalina.connector.Request;
import org.apache.catalina.connector.Response;
import org.apache.catalina.valves.ValveBase;

import javax.servlet.ServletException;
import java.io.IOException;

/**
 * @Auther: bl_xueld
 * @Date: 2022/1/6 11:23
 * @Description:
 */
public class PrintIPValve extends ValveBase {
    @Override
    public void invoke(Request request, Response response) throws IOException, ServletException {
        System.out.println(request.getRemoteAddr());
        getNext().invoke(request,response);
    }
}
